<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>
<script>
  // [xyz]    => x|y|z  匹配集合中的任意一个

  // 选择匹配符
  // (red|blue|green)    匹配 red,blue,green三者中的任意一个

  var str = "This box is green!";
  var reg = /(red|blue|green)/;
  console.log(reg.test(str));




</script>

</html>